Title: Multiple Deal Pipeline
To cater companies that have multiple sales process for different products or markets.
Available from Estate Plan.
Pipeline:
- Account Default - Deal pipeline with is_default as true
- User Default - Deal pipeline associated with the user profile
- In the absence of pipeline attribute. User operations like Import, New Deal will choose User Default pipeline. And Admin operation will choose Account level default pipeline.
- On Delete or Plan downgrade,
- Filter rules & Users migrated to account default pipeline.
- All deals moved to account default pipeline’s default stage
- In filter rules, the constant '-299' indicates the user default pipeline. It will be referred from here -> FsFilter::Constants::USER_DEFAULT_PIPELINE
- Limitation -
- 10 pipelines are allowed for an Account.
- Pipeline names can't be duplicated.
- Account default pipeline can’t be deleted.
Stage:
- Default choice type has been changed to '5' and it can't be deleted but can be edited and position cant be changed. It will be referred from here -> FormService::Constants::CHOICE_TYPES
- Every pipeline will contain 3 mandatory stages, 'New' - Top editable, 'Won' & 'Lost' - Bottom Non Editable. It will be referred from here -> Deals::Pipeline::DEFAULT_DEAL_STAGES
- Mandatory Stages Can't be deleted except the case when pipeline is deleted.
- Stage names are unique within the scope of Pipeline.
Associations:

- deal_pipeline has_many deal_stages
- deal_pipeline has_many deals
- deal belongs_to deal_pipeline
- deal_stage belongs_to deal_pipeline
Deal created via API:
- Pipeline should be specified
- If no pipeline is specified, deals get created in Users default pipeline
- Column Chooser: Pipeline is added as one of the fields in Deals
- Downgrade to lower plans than Garden will delete all deal pipelines except the default one, delete all deal stages related to the pipeline and move the deals of the pipelines to account default pipeline → New stage
Migrations:
- ContactCustomFilters & SalesAccountCustomFilters are updated with
- deal_pipeline_id wherever we have deal_stage_id rule
- DealCustomFilters are updated with deal_pipeline_id rule. It will be account level default pipeline id for custom views and ‘299’ for default / system views.
- Add deal_pipeline_id column
- Mysql - Deal, Deal Stage, User Profile
- Elastic Search
- Redshift
- Update deal_pipeline_id with account default
- pipeline_id
- Update choice type of default stage to 5 from 1
- (5 Indicates top_edit and 1 indicates top_read)
- Add MultiPipeline to plans
- Add is_deleted column to deal_pipeline
- Form Service: Add deal_pipeline in Deal Fields
Fixtures:
- DealCustomFilter is updated with deal_pipeline_id rule(with UserDefaultPIpleineConstant = ‘299’ )
- DealStage - default open stage choice type is updated to 5
CRM Data Migration:
ImportDealCsv -
Deal is going to map with pipeline and corresponding stage according to below conditions:
- If Pipeline is present, then map to corresponding pipeline and if Stage matched to one of this mapped Pipeline’s stage then map to corresponding stage else with pipeline’s default stage
- If Pipeline is blank/not present in account then map to Users default Pipeline and if Stage matched to users default pipeline stages then map it to corresponding stage else with pipeline’s default stage
Other Migrations -
Deal is going to map with pipeline and corresponding stage according to below conditions
- If Pipeline is present in account then map to corresponding Pipeline and If Stage matched to one of this mapped Pipeline’s stages then map to corresponding stage else create new stage in the mapped pipeline
- If Pipeline is blank then map to account default pipeline and If Stage matched with any of mapped pipeline stage then map it to the same else create new stage
- If Pipeline is not present in account then create pipeline and if stage matches with any of created pipeline’s stages then map it to the same else create stage.
Filters:
Deal stage always comes with Pipeline context.
SalesAccount & Contact - DealPipeline and Deal Stage are available in the filter options but not sticky.
Deal:
- List View: Pipeline and Stage are sticky, Pipeline dropdown defaults to User’s default pipeline
- Funnel View: In the UI, user can choose the pipeline for any system generated default views. And Users default pipeline is chosen by default in the dropdown.
Frontend

Deal multiple pipeline UML Diagrams (Model)
Deal pipeline Settings:

Route: deal-pipeline
Controllers: deal-pipeline
Components: deal-pipeline
Deal Field Settings:
Deal pipelines, Deal stages Fields :- Choices should be hidden, and link should be provided to Deal pipeline settings.
Territories Field :- Choices should be hidden, and link should be provided to Territories settings page.
Owners Field :- Choices should be hidden, and link should be provided to User settings page.
Deal Filters:
Deal filters , pipeline field should be added , which is single selection Dropdown.
Deal pipeline filed will be default sticky for deal filter view and always pipeline will be part of the rule associated with any view(Default, Custom Shared, Custom)
Deal stages field in filter will be updated based on change with deal pipeline field.
Account Filters :
Account filters has both pipeline and stage as non sticky field in filters.
Choosing Deal pipeline field and choosing a value in that field will update the deal stage field choices and make it visible.
Choosing Deal stage field will prefill Deal pipeline field with user prefered pipeline and will update deal stage field choices.
Deal Funnel :
Deal funnel page should have pipeline dropdown , which filter the deals based on views.
Pipeline dropdown shows all pipeline only in Default View.
Custom View and Custom Shared view will have the pipeline associated with that rule.
User Pipeline :
Pipeline preference is categorised into account level and user level
User level pipeline can be set in profile settings, when the user preferred pipeline is deleted the user preference is shifted to account level pipeline
RSpecs
RSpec coverage after this change across deal module is >95%.

Links
Git Initial Squash Commit : https://github.com/freshdesk/freshsales/commit/c01ca031ef247795da8601dd3756d7540e7e7a38
Spec :
Frontend Test case Coverage to Components related to Deal pipeline module .
components/deal-pipeline/ 93.86%
templates/shared/deal-pipeline/ 91.69%
components/modals/bulk-update/ 97.81%
components/filters/dependent-dropdown/ 100%
components/modals/edit-custom-field/ 67.01%
components/modals/deal-form/ 60.38%
Title: Multiple Deal Pipeline
To cater companies that have multiple sales process for different products or markets.
Available from Estate Plan.
Pipeline:
- Account Default - Deal pipeline with is_default as true
- User Default - Deal pipeline associated with the user profile
- In the absence of pipeline attribute. User operations like Import, New Deal will choose User Default pipeline. And Admin operation will choose Account level default pipeline.
- On Delete or Plan downgrade,
- Filter rules & Users migrated to account default pipeline.
- All deals moved to account default pipeline’s default stage
- In filter rules, the constant '-299' indicates the user default pipeline. It will be referred from here -> FsFilter::Constants::USER_DEFAULT_PIPELINE
- Limitation -
- 10 pipelines are allowed for an Account.
- Pipeline names can't be duplicated.
- Account default pipeline can’t be deleted.
Stage:
- Default choice type has been changed to '5' and it can't be deleted but can be edited and position cant be changed. It will be referred from here -> FormService::Constants::CHOICE_TYPES
- Every pipeline will contain 3 mandatory stages, 'New' - Top editable, 'Won' & 'Lost' - Bottom Non Editable. It will be referred from here -> Deals::Pipeline::DEFAULT_DEAL_STAGES
- Mandatory Stages Can't be deleted except the case when pipeline is deleted.
- Stage names are unique within the scope of Pipeline.
Associations:

- deal_pipeline has_many deal_stages
- deal_pipeline has_many deals
- deal belongs_to deal_pipeline
- deal_stage belongs_to deal_pipeline
Deal created via API:
- Pipeline should be specified
- If no pipeline is specified, deals get created in Users default pipeline
- Column Chooser: Pipeline is added as one of the fields in Deals
- Downgrade to lower plans than Garden will delete all deal pipelines except the default one, delete all deal stages related to the pipeline and move the deals of the pipelines to account default pipeline → New stage
Migrations:
- ContactCustomFilters & SalesAccountCustomFilters are updated with
- deal_pipeline_id wherever we have deal_stage_id rule
- DealCustomFilters are updated with deal_pipeline_id rule. It will be account level default pipeline id for custom views and ‘299’ for default / system views.
- Add deal_pipeline_id column
- Mysql - Deal, Deal Stage, User Profile
- Elastic Search
- Redshift
- Update deal_pipeline_id with account default
- pipeline_id
- Update choice type of default stage to 5 from 1
- (5 Indicates top_edit and 1 indicates top_read)
- Add MultiPipeline to plans
- Add is_deleted column to deal_pipeline
- Form Service: Add deal_pipeline in Deal Fields
Fixtures:
- DealCustomFilter is updated with deal_pipeline_id rule(with UserDefaultPIpleineConstant = ‘299’ )
- DealStage - default open stage choice type is updated to 5
CRM Data Migration:
ImportDealCsv -
Deal is going to map with pipeline and corresponding stage according to below conditions:
- If Pipeline is present, then map to corresponding pipeline and if Stage matched to one of this mapped Pipeline’s stage then map to corresponding stage else with pipeline’s default stage
- If Pipeline is blank/not present in account then map to Users default Pipeline and if Stage matched to users default pipeline stages then map it to corresponding stage else with pipeline’s default stage
Other Migrations -
Deal is going to map with pipeline and corresponding stage according to below conditions
- If Pipeline is present in account then map to corresponding Pipeline and If Stage matched to one of this mapped Pipeline’s stages then map to corresponding stage else create new stage in the mapped pipeline
- If Pipeline is blank then map to account default pipeline and If Stage matched with any of mapped pipeline stage then map it to the same else create new stage
- If Pipeline is not present in account then create pipeline and if stage matches with any of created pipeline’s stages then map it to the same else create stage.
Filters:
Deal stage always comes with Pipeline context.
SalesAccount & Contact - DealPipeline and Deal Stage are available in the filter options but not sticky.
Deal:
- List View: Pipeline and Stage are sticky, Pipeline dropdown defaults to User’s default pipeline
- Funnel View: In the UI, user can choose the pipeline for any system generated default views. And Users default pipeline is chosen by default in the dropdown.
Frontend

Deal multiple pipeline UML Diagrams (Model)
Deal pipeline Settings:

Route: deal-pipeline
Controllers: deal-pipeline
Components: deal-pipeline
Deal Field Settings:
Deal pipelines, Deal stages Fields :- Choices should be hidden, and link should be provided to Deal pipeline settings.
Territories Field :- Choices should be hidden, and link should be provided to Territories settings page.
Owners Field :- Choices should be hidden, and link should be provided to User settings page.
Deal Filters:
Deal filters , pipeline field should be added , which is single selection Dropdown.
Deal pipeline filed will be default sticky for deal filter view and always pipeline will be part of the rule associated with any view(Default, Custom Shared, Custom)
Deal stages field in filter will be updated based on change with deal pipeline field.
Account Filters :
Account filters has both pipeline and stage as non sticky field in filters.
Choosing Deal pipeline field and choosing a value in that field will update the deal stage field choices and make it visible.
Choosing Deal stage field will prefill Deal pipeline field with user prefered pipeline and will update deal stage field choices.
Deal Funnel :
Deal funnel page should have pipeline dropdown , which filter the deals based on views.
Pipeline dropdown shows all pipeline only in Default View.
Custom View and Custom Shared view will have the pipeline associated with that rule.
User Pipeline :
Pipeline preference is categorised into account level and user level
User level pipeline can be set in profile settings, when the user preferred pipeline is deleted the user preference is shifted to account level pipeline
RSpecs
RSpec coverage after this change across deal module is >95%.

Links
Git Initial Squash Commit : https://github.com/freshdesk/freshsales/commit/c01ca031ef247795da8601dd3756d7540e7e7a38
Spec :
Frontend Test case Coverage to Components related to Deal pipeline module .
components/deal-pipeline/ 93.86%
templates/shared/deal-pipeline/ 91.69%
components/modals/bulk-update/ 97.81%
components/filters/dependent-dropdown/ 100%
components/modals/edit-custom-field/ 67.01%
components/modals/deal-form/ 60.38%
Title: Multiple Deal Pipeline
To cater companies that have multiple sales process for different products or markets.
Available from Estate Plan.
Pipeline:
- Account Default - Deal pipeline with is_default as true
- User Default - Deal pipeline associated with the user profile
- In the absence of pipeline attribute. User operations like Import, New Deal will choose User Default pipeline. And Admin operation will choose Account level default pipeline.
- On Delete or Plan downgrade,
- Filter rules & Users migrated to account default pipeline.
- All deals moved to account default pipeline’s default stage
- In filter rules, the constant '-299' indicates the user default pipeline. It will be referred from here -> FsFilter::Constants::USER_DEFAULT_PIPELINE
- Limitation -
- 10 pipelines are allowed for an Account.
- Pipeline names can't be duplicated.
- Account default pipeline can’t be deleted.
Stage:
- Default choice type has been changed to '5' and it can't be deleted but can be edited and position cant be changed. It will be referred from here -> FormService::Constants::CHOICE_TYPES
- Every pipeline will contain 3 mandatory stages, 'New' - Top editable, 'Won' & 'Lost' - Bottom Non Editable. It will be referred from here -> Deals::Pipeline::DEFAULT_DEAL_STAGES
- Mandatory Stages Can't be deleted except the case when pipeline is deleted.
- Stage names are unique within the scope of Pipeline.
Associations:

- deal_pipeline has_many deal_stages
- deal_pipeline has_many deals
- deal belongs_to deal_pipeline
- deal_stage belongs_to deal_pipeline
Deal created via API:
- Pipeline should be specified
- If no pipeline is specified, deals get created in Users default pipeline
- Column Chooser: Pipeline is added as one of the fields in Deals
- Downgrade to lower plans than Garden will delete all deal pipelines except the default one, delete all deal stages related to the pipeline and move the deals of the pipelines to account default pipeline → New stage
Migrations:
- ContactCustomFilters & SalesAccountCustomFilters are updated with
- deal_pipeline_id wherever we have deal_stage_id rule
- DealCustomFilters are updated with deal_pipeline_id rule. It will be account level default pipeline id for custom views and ‘299’ for default / system views.
- Add deal_pipeline_id column
- Mysql - Deal, Deal Stage, User Profile
- Elastic Search
- Redshift
- Update deal_pipeline_id with account default
- pipeline_id
- Update choice type of default stage to 5 from 1
- (5 Indicates top_edit and 1 indicates top_read)
- Add MultiPipeline to plans
- Add is_deleted column to deal_pipeline
- Form Service: Add deal_pipeline in Deal Fields
Fixtures:
- DealCustomFilter is updated with deal_pipeline_id rule(with UserDefaultPIpleineConstant = ‘299’ )
- DealStage - default open stage choice type is updated to 5
CRM Data Migration:
ImportDealCsv -
Deal is going to map with pipeline and corresponding stage according to below conditions:
- If Pipeline is present, then map to corresponding pipeline and if Stage matched to one of this mapped Pipeline’s stage then map to corresponding stage else with pipeline’s default stage
- If Pipeline is blank/not present in account then map to Users default Pipeline and if Stage matched to users default pipeline stages then map it to corresponding stage else with pipeline’s default stage
Other Migrations -
Deal is going to map with pipeline and corresponding stage according to below conditions
- If Pipeline is present in account then map to corresponding Pipeline and If Stage matched to one of this mapped Pipeline’s stages then map to corresponding stage else create new stage in the mapped pipeline
- If Pipeline is blank then map to account default pipeline and If Stage matched with any of mapped pipeline stage then map it to the same else create new stage
- If Pipeline is not present in account then create pipeline and if stage matches with any of created pipeline’s stages then map it to the same else create stage.
Filters:
Deal stage always comes with Pipeline context.
SalesAccount & Contact - DealPipeline and Deal Stage are available in the filter options but not sticky.
Deal:
- List View: Pipeline and Stage are sticky, Pipeline dropdown defaults to User’s default pipeline
- Funnel View: In the UI, user can choose the pipeline for any system generated default views. And Users default pipeline is chosen by default in the dropdown.
Frontend

Deal multiple pipeline UML Diagrams (Model)
Deal pipeline Settings:

Route: deal-pipeline
Controllers: deal-pipeline
Components: deal-pipeline
Deal Field Settings:
Deal pipelines, Deal stages Fields :- Choices should be hidden, and link should be provided to Deal pipeline settings.
Territories Field :- Choices should be hidden, and link should be provided to Territories settings page.
Owners Field :- Choices should be hidden, and link should be provided to User settings page.
Deal Filters:
Deal filters , pipeline field should be added , which is single selection Dropdown.
Deal pipeline filed will be default sticky for deal filter view and always pipeline will be part of the rule associated with any view(Default, Custom Shared, Custom)
Deal stages field in filter will be updated based on change with deal pipeline field.
Account Filters :
Account filters has both pipeline and stage as non sticky field in filters.
Choosing Deal pipeline field and choosing a value in that field will update the deal stage field choices and make it visible.
Choosing Deal stage field will prefill Deal pipeline field with user prefered pipeline and will update deal stage field choices.
Deal Funnel :
Deal funnel page should have pipeline dropdown , which filter the deals based on views.
Pipeline dropdown shows all pipeline only in Default View.
Custom View and Custom Shared view will have the pipeline associated with that rule.
User Pipeline :
Pipeline preference is categorised into account level and user level
User level pipeline can be set in profile settings, when the user preferred pipeline is deleted the user preference is shifted to account level pipeline
RSpecs
RSpec coverage after this change across deal module is >95%.

Links
Git Initial Squash Commit : https://github.com/freshdesk/freshsales/commit/c01ca031ef247795da8601dd3756d7540e7e7a38
Spec :
Frontend Test case Coverage to Components related to Deal pipeline module .
components/deal-pipeline/ 93.86%
templates/shared/deal-pipeline/ 91.69%
components/modals/bulk-update/ 97.81%
components/filters/dependent-dropdown/ 100%
components/modals/edit-custom-field/ 67.01%
components/modals/deal-form/ 60.38%
Title: Multiple Deal Pipeline
To cater companies that have multiple sales process for different products or markets.
Available from Estate Plan.
Pipeline:
- Account Default - Deal pipeline with is_default as true
- User Default - Deal pipeline associated with the user profile
- In the absence of pipeline attribute. User operations like Import, New Deal will choose User Default pipeline. And Admin operation will choose Account level default pipeline.
- On Delete or Plan downgrade,
- Filter rules & Users migrated to account default pipeline.
- All deals moved to account default pipeline’s default stage
- In filter rules, the constant '-299' indicates the user default pipeline. It will be referred from here -> FsFilter::Constants::USER_DEFAULT_PIPELINE
- Limitation -
- 10 pipelines are allowed for an Account.
- Pipeline names can't be duplicated.
- Account default pipeline can’t be deleted.
Stage:
- Default choice type has been changed to '5' and it can't be deleted but can be edited and position cant be changed. It will be referred from here -> FormService::Constants::CHOICE_TYPES
- Every pipeline will contain 3 mandatory stages, 'New' - Top editable, 'Won' & 'Lost' - Bottom Non Editable. It will be referred from here -> Deals::Pipeline::DEFAULT_DEAL_STAGES
- Mandatory Stages Can't be deleted except the case when pipeline is deleted.
- Stage names are unique within the scope of Pipeline.
Associations:

- deal_pipeline has_many deal_stages
- deal_pipeline has_many deals
- deal belongs_to deal_pipeline
- deal_stage belongs_to deal_pipeline
Deal created via API:
- Pipeline should be specified
- If no pipeline is specified, deals get created in Users default pipeline
- Column Chooser: Pipeline is added as one of the fields in Deals
- Downgrade to lower plans than Garden will delete all deal pipelines except the default one, delete all deal stages related to the pipeline and move the deals of the pipelines to account default pipeline → New stage
Migrations:
- ContactCustomFilters & SalesAccountCustomFilters are updated with
- deal_pipeline_id wherever we have deal_stage_id rule
- DealCustomFilters are updated with deal_pipeline_id rule. It will be account level default pipeline id for custom views and ‘299’ for default / system views.
- Add deal_pipeline_id column
- Mysql - Deal, Deal Stage, User Profile
- Elastic Search
- Redshift
- Update deal_pipeline_id with account default
- pipeline_id
- Update choice type of default stage to 5 from 1
- (5 Indicates top_edit and 1 indicates top_read)
- Add MultiPipeline to plans
- Add is_deleted column to deal_pipeline
- Form Service: Add deal_pipeline in Deal Fields
Fixtures:
- DealCustomFilter is updated with deal_pipeline_id rule(with UserDefaultPIpleineConstant = ‘299’ )
- DealStage - default open stage choice type is updated to 5
CRM Data Migration:
ImportDealCsv -
Deal is going to map with pipeline and corresponding stage according to below conditions:
- If Pipeline is present, then map to corresponding pipeline and if Stage matched to one of this mapped Pipeline’s stage then map to corresponding stage else with pipeline’s default stage
- If Pipeline is blank/not present in account then map to Users default Pipeline and if Stage matched to users default pipeline stages then map it to corresponding stage else with pipeline’s default stage
Other Migrations -
Deal is going to map with pipeline and corresponding stage according to below conditions
- If Pipeline is present in account then map to corresponding Pipeline and If Stage matched to one of this mapped Pipeline’s stages then map to corresponding stage else create new stage in the mapped pipeline
- If Pipeline is blank then map to account default pipeline and If Stage matched with any of mapped pipeline stage then map it to the same else create new stage
- If Pipeline is not present in account then create pipeline and if stage matches with any of created pipeline’s stages then map it to the same else create stage.
Filters:
Deal stage always comes with Pipeline context.
SalesAccount & Contact - DealPipeline and Deal Stage are available in the filter options but not sticky.
Deal:
- List View: Pipeline and Stage are sticky, Pipeline dropdown defaults to User’s default pipeline
- Funnel View: In the UI, user can choose the pipeline for any system generated default views. And Users default pipeline is chosen by default in the dropdown.
Frontend

Deal multiple pipeline UML Diagrams (Model)
Deal pipeline Settings:

Route: deal-pipeline
Controllers: deal-pipeline
Components: deal-pipeline
Deal Field Settings:
Deal pipelines, Deal stages Fields :- Choices should be hidden, and link should be provided to Deal pipeline settings.
Territories Field :- Choices should be hidden, and link should be provided to Territories settings page.
Owners Field :- Choices should be hidden, and link should be provided to User settings page.
Deal Filters:
Deal filters , pipeline field should be added , which is single selection Dropdown.
Deal pipeline filed will be default sticky for deal filter view and always pipeline will be part of the rule associated with any view(Default, Custom Shared, Custom)
Deal stages field in filter will be updated based on change with deal pipeline field.
Account Filters :
Account filters has both pipeline and stage as non sticky field in filters.
Choosing Deal pipeline field and choosing a value in that field will update the deal stage field choices and make it visible.
Choosing Deal stage field will prefill Deal pipeline field with user prefered pipeline and will update deal stage field choices.
Deal Funnel :
Deal funnel page should have pipeline dropdown , which filter the deals based on views.
Pipeline dropdown shows all pipeline only in Default View.
Custom View and Custom Shared view will have the pipeline associated with that rule.
User Pipeline :
Pipeline preference is categorised into account level and user level
User level pipeline can be set in profile settings, when the user preferred pipeline is deleted the user preference is shifted to account level pipeline
RSpecs
RSpec coverage after this change across deal module is >95%.

Links
Git Initial Squash Commit : https://github.com/freshdesk/freshsales/commit/c01ca031ef247795da8601dd3756d7540e7e7a38
Spec :
Frontend Test case Coverage to Components related to Deal pipeline module .
components/deal-pipeline/ 93.86%
templates/shared/deal-pipeline/ 91.69%
components/modals/bulk-update/ 97.81%
components/filters/dependent-dropdown/ 100%
components/modals/edit-custom-field/ 67.01%
components/modals/deal-form/ 60.38%
Title: Multiple Deal Pipeline
To cater companies that have multiple sales process for different products or markets.
Available from Estate Plan.
Pipeline:
- Account Default - Deal pipeline with is_default as true
- User Default - Deal pipeline associated with the user profile
- In the absence of pipeline attribute. User operations like Import, New Deal will choose User Default pipeline. And Admin operation will choose Account level default pipeline.
- On Delete or Plan downgrade,
- Filter rules & Users migrated to account default pipeline.
- All deals moved to account default pipeline’s default stage
- In filter rules, the constant '-299' indicates the user default pipeline. It will be referred from here -> FsFilter::Constants::USER_DEFAULT_PIPELINE
- Limitation -
- 10 pipelines are allowed for an Account.
- Pipeline names can't be duplicated.
- Account default pipeline can’t be deleted.
Stage:
- Default choice type has been changed to '5' and it can't be deleted but can be edited and position cant be changed. It will be referred from here -> FormService::Constants::CHOICE_TYPES
- Every pipeline will contain 3 mandatory stages, 'New' - Top editable, 'Won' & 'Lost' - Bottom Non Editable. It will be referred from here -> Deals::Pipeline::DEFAULT_DEAL_STAGES
- Mandatory Stages Can't be deleted except the case when pipeline is deleted.
- Stage names are unique within the scope of Pipeline.
Associations:

- deal_pipeline has_many deal_stages
- deal_pipeline has_many deals
- deal belongs_to deal_pipeline
- deal_stage belongs_to deal_pipeline
Deal created via API:
- Pipeline should be specified
- If no pipeline is specified, deals get created in Users default pipeline
- Column Chooser: Pipeline is added as one of the fields in Deals
- Downgrade to lower plans than Garden will delete all deal pipelines except the default one, delete all deal stages related to the pipeline and move the deals of the pipelines to account default pipeline → New stage
Migrations:
- ContactCustomFilters & SalesAccountCustomFilters are updated with
- deal_pipeline_id wherever we have deal_stage_id rule
- DealCustomFilters are updated with deal_pipeline_id rule. It will be account level default pipeline id for custom views and ‘299’ for default / system views.
- Add deal_pipeline_id column
- Mysql - Deal, Deal Stage, User Profile
- Elastic Search
- Redshift
- Update deal_pipeline_id with account default
- pipeline_id
- Update choice type of default stage to 5 from 1
- (5 Indicates top_edit and 1 indicates top_read)
- Add MultiPipeline to plans
- Add is_deleted column to deal_pipeline
- Form Service: Add deal_pipeline in Deal Fields
Fixtures:
- DealCustomFilter is updated with deal_pipeline_id rule(with UserDefaultPIpleineConstant = ‘299’ )
- DealStage - default open stage choice type is updated to 5
CRM Data Migration:
ImportDealCsv -
Deal is going to map with pipeline and corresponding stage according to below conditions:
- If Pipeline is present, then map to corresponding pipeline and if Stage matched to one of this mapped Pipeline’s stage then map to corresponding stage else with pipeline’s default stage
- If Pipeline is blank/not present in account then map to Users default Pipeline and if Stage matched to users default pipeline stages then map it to corresponding stage else with pipeline’s default stage
Other Migrations -
Deal is going to map with pipeline and corresponding stage according to below conditions
- If Pipeline is present in account then map to corresponding Pipeline and If Stage matched to one of this mapped Pipeline’s stages then map to corresponding stage else create new stage in the mapped pipeline
- If Pipeline is blank then map to account default pipeline and If Stage matched with any of mapped pipeline stage then map it to the same else create new stage
- If Pipeline is not present in account then create pipeline and if stage matches with any of created pipeline’s stages then map it to the same else create stage.
Filters:
Deal stage always comes with Pipeline context.
SalesAccount & Contact - DealPipeline and Deal Stage are available in the filter options but not sticky.
Deal:
- List View: Pipeline and Stage are sticky, Pipeline dropdown defaults to User’s default pipeline
- Funnel View: In the UI, user can choose the pipeline for any system generated default views. And Users default pipeline is chosen by default in the dropdown.
Frontend

Deal multiple pipeline UML Diagrams (Model)
Deal pipeline Settings:

Route: deal-pipeline
Controllers: deal-pipeline
Components: deal-pipeline
Deal Field Settings:
Deal pipelines, Deal stages Fields :- Choices should be hidden, and link should be provided to Deal pipeline settings.
Territories Field :- Choices should be hidden, and link should be provided to Territories settings page.
Owners Field :- Choices should be hidden, and link should be provided to User settings page.
Deal Filters:
Deal filters , pipeline field should be added , which is single selection Dropdown.
Deal pipeline filed will be default sticky for deal filter view and always pipeline will be part of the rule associated with any view(Default, Custom Shared, Custom)
Deal stages field in filter will be updated based on change with deal pipeline field.
Account Filters :
Account filters has both pipeline and stage as non sticky field in filters.
Choosing Deal pipeline field and choosing a value in that field will update the deal stage field choices and make it visible.
Choosing Deal stage field will prefill Deal pipeline field with user prefered pipeline and will update deal stage field choices.
Deal Funnel :
Deal funnel page should have pipeline dropdown , which filter the deals based on views.
Pipeline dropdown shows all pipeline only in Default View.
Custom View and Custom Shared view will have the pipeline associated with that rule.
User Pipeline :
Pipeline preference is categorised into account level and user level
User level pipeline can be set in profile settings, when the user preferred pipeline is deleted the user preference is shifted to account level pipeline
RSpecs
RSpec coverage after this change across deal module is >95%.

Links
Git Initial Squash Commit : https://github.com/freshdesk/freshsales/commit/c01ca031ef247795da8601dd3756d7540e7e7a38
Spec :
Frontend Test case Coverage to Components related to Deal pipeline module .
components/deal-pipeline/ 93.86%
templates/shared/deal-pipeline/ 91.69%
components/modals/bulk-update/ 97.81%
components/filters/dependent-dropdown/ 100%
components/modals/edit-custom-field/ 67.01%
components/modals/deal-form/ 60.38%
Title: Multiple Deal Pipeline
To cater companies that have multiple sales process for different products or markets.
Available from Estate Plan.
Pipeline:
- Account Default - Deal pipeline with is_default as true
- User Default - Deal pipeline associated with the user profile
- In the absence of pipeline attribute. User operations like Import, New Deal will choose User Default pipeline. And Admin operation will choose Account level default pipeline.
- On Delete or Plan downgrade,
- Filter rules & Users migrated to account default pipeline.
- All deals moved to account default pipeline’s default stage
- In filter rules, the constant '-299' indicates the user default pipeline. It will be referred from here -> FsFilter::Constants::USER_DEFAULT_PIPELINE
- Limitation -
- 10 pipelines are allowed for an Account.
- Pipeline names can't be duplicated.
- Account default pipeline can’t be deleted.
Stage:
- Default choice type has been changed to '5' and it can't be deleted but can be edited and position cant be changed. It will be referred from here -> FormService::Constants::CHOICE_TYPES
- Every pipeline will contain 3 mandatory stages, 'New' - Top editable, 'Won' & 'Lost' - Bottom Non Editable. It will be referred from here -> Deals::Pipeline::DEFAULT_DEAL_STAGES
- Mandatory Stages Can't be deleted except the case when pipeline is deleted.
- Stage names are unique within the scope of Pipeline.
Associations:

- deal_pipeline has_many deal_stages
- deal_pipeline has_many deals
- deal belongs_to deal_pipeline
- deal_stage belongs_to deal_pipeline
Deal created via API:
- Pipeline should be specified
- If no pipeline is specified, deals get created in Users default pipeline
- Column Chooser: Pipeline is added as one of the fields in Deals
- Downgrade to lower plans than Garden will delete all deal pipelines except the default one, delete all deal stages related to the pipeline and move the deals of the pipelines to account default pipeline → New stage
Migrations:
- ContactCustomFilters & SalesAccountCustomFilters are updated with
- deal_pipeline_id wherever we have deal_stage_id rule
- DealCustomFilters are updated with deal_pipeline_id rule. It will be account level default pipeline id for custom views and ‘299’ for default / system views.
- Add deal_pipeline_id column
- Mysql - Deal, Deal Stage, User Profile
- Elastic Search
- Redshift
- Update deal_pipeline_id with account default
- pipeline_id
- Update choice type of default stage to 5 from 1
- (5 Indicates top_edit and 1 indicates top_read)
- Add MultiPipeline to plans
- Add is_deleted column to deal_pipeline
- Form Service: Add deal_pipeline in Deal Fields
Fixtures:
- DealCustomFilter is updated with deal_pipeline_id rule(with UserDefaultPIpleineConstant = ‘299’ )
- DealStage - default open stage choice type is updated to 5
CRM Data Migration:
ImportDealCsv -
Deal is going to map with pipeline and corresponding stage according to below conditions:
- If Pipeline is present, then map to corresponding pipeline and if Stage matched to one of this mapped Pipeline’s stage then map to corresponding stage else with pipeline’s default stage
- If Pipeline is blank/not present in account then map to Users default Pipeline and if Stage matched to users default pipeline stages then map it to corresponding stage else with pipeline’s default stage
Other Migrations -
Deal is going to map with pipeline and corresponding stage according to below conditions
- If Pipeline is present in account then map to corresponding Pipeline and If Stage matched to one of this mapped Pipeline’s stages then map to corresponding stage else create new stage in the mapped pipeline
- If Pipeline is blank then map to account default pipeline and If Stage matched with any of mapped pipeline stage then map it to the same else create new stage
- If Pipeline is not present in account then create pipeline and if stage matches with any of created pipeline’s stages then map it to the same else create stage.
Filters:
Deal stage always comes with Pipeline context.
SalesAccount & Contact - DealPipeline and Deal Stage are available in the filter options but not sticky.
Deal:
- List View: Pipeline and Stage are sticky, Pipeline dropdown defaults to User’s default pipeline
- Funnel View: In the UI, user can choose the pipeline for any system generated default views. And Users default pipeline is chosen by default in the dropdown.
Frontend

Deal multiple pipeline UML Diagrams (Model)
Deal pipeline Settings:

Route: deal-pipeline
Controllers: deal-pipeline
Components: deal-pipeline
Deal Field Settings:
Deal pipelines, Deal stages Fields :- Choices should be hidden, and link should be provided to Deal pipeline settings.
Territories Field :- Choices should be hidden, and link should be provided to Territories settings page.
Owners Field :- Choices should be hidden, and link should be provided to User settings page.
Deal Filters:
Deal filters , pipeline field should be added , which is single selection Dropdown.
Deal pipeline filed will be default sticky for deal filter view and always pipeline will be part of the rule associated with any view(Default, Custom Shared, Custom)
Deal stages field in filter will be updated based on change with deal pipeline field.
Account Filters :
Account filters has both pipeline and stage as non sticky field in filters.
Choosing Deal pipeline field and choosing a value in that field will update the deal stage field choices and make it visible.
Choosing Deal stage field will prefill Deal pipeline field with user prefered pipeline and will update deal stage field choices.
Deal Funnel :
Deal funnel page should have pipeline dropdown , which filter the deals based on views.
Pipeline dropdown shows all pipeline only in Default View.
Custom View and Custom Shared view will have the pipeline associated with that rule.
User Pipeline :
Pipeline preference is categorised into account level and user level
User level pipeline can be set in profile settings, when the user preferred pipeline is deleted the user preference is shifted to account level pipeline
RSpecs
RSpec coverage after this change across deal module is >95%.

Links
Git Initial Squash Commit : https://github.com/freshdesk/freshsales/commit/c01ca031ef247795da8601dd3756d7540e7e7a38
Spec :
Frontend Test case Coverage to Components related to Deal pipeline module .
components/deal-pipeline/ 93.86%
templates/shared/deal-pipeline/ 91.69%
components/modals/bulk-update/ 97.81%
components/filters/dependent-dropdown/ 100%
components/modals/edit-custom-field/ 67.01%
components/modals/deal-form/ 60.38%
Title: Multiple Deal Pipeline
To cater companies that have multiple sales process for different products or markets.
Available from Estate Plan.
Pipeline:
- Account Default - Deal pipeline with is_default as true
- User Default - Deal pipeline associated with the user profile
- In the absence of pipeline attribute. User operations like Import, New Deal will choose User Default pipeline. And Admin operation will choose Account level default pipeline.
- On Delete or Plan downgrade,
- Filter rules & Users migrated to account default pipeline.
- All deals moved to account default pipeline’s default stage
- In filter rules, the constant '-299' indicates the user default pipeline. It will be referred from here -> FsFilter::Constants::USER_DEFAULT_PIPELINE
- Limitation -
- 10 pipelines are allowed for an Account.
- Pipeline names can't be duplicated.
- Account default pipeline can’t be deleted.
Stage:
- Default choice type has been changed to '5' and it can't be deleted but can be edited and position cant be changed. It will be referred from here -> FormService::Constants::CHOICE_TYPES
- Every pipeline will contain 3 mandatory stages, 'New' - Top editable, 'Won' & 'Lost' - Bottom Non Editable. It will be referred from here -> Deals::Pipeline::DEFAULT_DEAL_STAGES
- Mandatory Stages Can't be deleted except the case when pipeline is deleted.
- Stage names are unique within the scope of Pipeline.
Associations:

- deal_pipeline has_many deal_stages
- deal_pipeline has_many deals
- deal belongs_to deal_pipeline
- deal_stage belongs_to deal_pipeline
Deal created via API:
- Pipeline should be specified
- If no pipeline is specified, deals get created in Users default pipeline
- Column Chooser: Pipeline is added as one of the fields in Deals
- Downgrade to lower plans than Garden will delete all deal pipelines except the default one, delete all deal stages related to the pipeline and move the deals of the pipelines to account default pipeline → New stage
Migrations:
- ContactCustomFilters & SalesAccountCustomFilters are updated with
- deal_pipeline_id wherever we have deal_stage_id rule
- DealCustomFilters are updated with deal_pipeline_id rule. It will be account level default pipeline id for custom views and ‘299’ for default / system views.
- Add deal_pipeline_id column
- Mysql - Deal, Deal Stage, User Profile
- Elastic Search
- Redshift
- Update deal_pipeline_id with account default
- pipeline_id
- Update choice type of default stage to 5 from 1
- (5 Indicates top_edit and 1 indicates top_read)
- Add MultiPipeline to plans
- Add is_deleted column to deal_pipeline
- Form Service: Add deal_pipeline in Deal Fields
Fixtures:
- DealCustomFilter is updated with deal_pipeline_id rule(with UserDefaultPIpleineConstant = ‘299’ )
- DealStage - default open stage choice type is updated to 5
CRM Data Migration:
ImportDealCsv -
Deal is going to map with pipeline and corresponding stage according to below conditions:
- If Pipeline is present, then map to corresponding pipeline and if Stage matched to one of this mapped Pipeline’s stage then map to corresponding stage else with pipeline’s default stage
- If Pipeline is blank/not present in account then map to Users default Pipeline and if Stage matched to users default pipeline stages then map it to corresponding stage else with pipeline’s default stage
Other Migrations -
Deal is going to map with pipeline and corresponding stage according to below conditions
- If Pipeline is present in account then map to corresponding Pipeline and If Stage matched to one of this mapped Pipeline’s stages then map to corresponding stage else create new stage in the mapped pipeline
- If Pipeline is blank then map to account default pipeline and If Stage matched with any of mapped pipeline stage then map it to the same else create new stage
- If Pipeline is not present in account then create pipeline and if stage matches with any of created pipeline’s stages then map it to the same else create stage.
Filters:
Deal stage always comes with Pipeline context.
SalesAccount & Contact - DealPipeline and Deal Stage are available in the filter options but not sticky.
Deal:
- List View: Pipeline and Stage are sticky, Pipeline dropdown defaults to User’s default pipeline
- Funnel View: In the UI, user can choose the pipeline for any system generated default views. And Users default pipeline is chosen by default in the dropdown.
Frontend

Deal multiple pipeline UML Diagrams (Model)
Deal pipeline Settings:

Route: deal-pipeline
Controllers: deal-pipeline
Components: deal-pipeline
Deal Field Settings:
Deal pipelines, Deal stages Fields :- Choices should be hidden, and link should be provided to Deal pipeline settings.
Territories Field :- Choices should be hidden, and link should be provided to Territories settings page.
Owners Field :- Choices should be hidden, and link should be provided to User settings page.
Deal Filters:
Deal filters , pipeline field should be added , which is single selection Dropdown.
Deal pipeline filed will be default sticky for deal filter view and always pipeline will be part of the rule associated with any view(Default, Custom Shared, Custom)
Deal stages field in filter will be updated based on change with deal pipeline field.
Account Filters :
Account filters has both pipeline and stage as non sticky field in filters.
Choosing Deal pipeline field and choosing a value in that field will update the deal stage field choices and make it visible.
Choosing Deal stage field will prefill Deal pipeline field with user prefered pipeline and will update deal stage field choices.
Deal Funnel :
Deal funnel page should have pipeline dropdown , which filter the deals based on views.
Pipeline dropdown shows all pipeline only in Default View.
Custom View and Custom Shared view will have the pipeline associated with that rule.
User Pipeline :
Pipeline preference is categorised into account level and user level
User level pipeline can be set in profile settings, when the user preferred pipeline is deleted the user preference is shifted to account level pipeline
RSpecs
RSpec coverage after this change across deal module is >95%.

Links
Git Initial Squash Commit : https://github.com/freshdesk/freshsales/commit/c01ca031ef247795da8601dd3756d7540e7e7a38
Spec :
Frontend Test case Coverage to Components related to Deal pipeline module .
components/deal-pipeline/ 93.86%
templates/shared/deal-pipeline/ 91.69%
components/modals/bulk-update/ 97.81%
components/filters/dependent-dropdown/ 100%
components/modals/edit-custom-field/ 67.01%
components/modals/deal-form/ 60.38%
Title: Multiple Deal Pipeline
To cater companies that have multiple sales process for different products or markets.
Available from Estate Plan.
Pipeline:
- Account Default - Deal pipeline with is_default as true
- User Default - Deal pipeline associated with the user profile
- In the absence of pipeline attribute. User operations like Import, New Deal will choose User Default pipeline. And Admin operation will choose Account level default pipeline.
- On Delete or Plan downgrade,
- Filter rules & Users migrated to account default pipeline.
- All deals moved to account default pipeline’s default stage
- In filter rules, the constant '-299' indicates the user default pipeline. It will be referred from here -> FsFilter::Constants::USER_DEFAULT_PIPELINE
- Limitation -
- 10 pipelines are allowed for an Account.
- Pipeline names can't be duplicated.
- Account default pipeline can’t be deleted.
Stage:
- Default choice type has been changed to '5' and it can't be deleted but can be edited and position cant be changed. It will be referred from here -> FormService::Constants::CHOICE_TYPES
- Every pipeline will contain 3 mandatory stages, 'New' - Top editable, 'Won' & 'Lost' - Bottom Non Editable. It will be referred from here -> Deals::Pipeline::DEFAULT_DEAL_STAGES
- Mandatory Stages Can't be deleted except the case when pipeline is deleted.
- Stage names are unique within the scope of Pipeline.
Associations:

- deal_pipeline has_many deal_stages
- deal_pipeline has_many deals
- deal belongs_to deal_pipeline
- deal_stage belongs_to deal_pipeline
Deal created via API:
- Pipeline should be specified
- If no pipeline is specified, deals get created in Users default pipeline
- Column Chooser: Pipeline is added as one of the fields in Deals
- Downgrade to lower plans than Garden will delete all deal pipelines except the default one, delete all deal stages related to the pipeline and move the deals of the pipelines to account default pipeline → New stage
Migrations:
- ContactCustomFilters & SalesAccountCustomFilters are updated with
- deal_pipeline_id wherever we have deal_stage_id rule
- DealCustomFilters are updated with deal_pipeline_id rule. It will be account level default pipeline id for custom views and ‘299’ for default / system views.
- Add deal_pipeline_id column
- Mysql - Deal, Deal Stage, User Profile
- Elastic Search
- Redshift
- Update deal_pipeline_id with account default
- pipeline_id
- Update choice type of default stage to 5 from 1
- (5 Indicates top_edit and 1 indicates top_read)
- Add MultiPipeline to plans
- Add is_deleted column to deal_pipeline
- Form Service: Add deal_pipeline in Deal Fields
Fixtures:
- DealCustomFilter is updated with deal_pipeline_id rule(with UserDefaultPIpleineConstant = ‘299’ )
- DealStage - default open stage choice type is updated to 5
CRM Data Migration:
ImportDealCsv -
Deal is going to map with pipeline and corresponding stage according to below conditions:
- If Pipeline is present, then map to corresponding pipeline and if Stage matched to one of this mapped Pipeline’s stage then map to corresponding stage else with pipeline’s default stage
- If Pipeline is blank/not present in account then map to Users default Pipeline and if Stage matched to users default pipeline stages then map it to corresponding stage else with pipeline’s default stage
Other Migrations -
Deal is going to map with pipeline and corresponding stage according to below conditions
- If Pipeline is present in account then map to corresponding Pipeline and If Stage matched to one of this mapped Pipeline’s stages then map to corresponding stage else create new stage in the mapped pipeline
- If Pipeline is blank then map to account default pipeline and If Stage matched with any of mapped pipeline stage then map it to the same else create new stage
- If Pipeline is not present in account then create pipeline and if stage matches with any of created pipeline’s stages then map it to the same else create stage.
Filters:
Deal stage always comes with Pipeline context.
SalesAccount & Contact - DealPipeline and Deal Stage are available in the filter options but not sticky.
Deal:
- List View: Pipeline and Stage are sticky, Pipeline dropdown defaults to User’s default pipeline
- Funnel View: In the UI, user can choose the pipeline for any system generated default views. And Users default pipeline is chosen by default in the dropdown.
Frontend

Deal multiple pipeline UML Diagrams (Model)
Deal pipeline Settings:

Route: deal-pipeline
Controllers: deal-pipeline
Components: deal-pipeline
Deal Field Settings:
Deal pipelines, Deal stages Fields :- Choices should be hidden, and link should be provided to Deal pipeline settings.
Territories Field :- Choices should be hidden, and link should be provided to Territories settings page.
Owners Field :- Choices should be hidden, and link should be provided to User settings page.
Deal Filters:
Deal filters , pipeline field should be added , which is single selection Dropdown.
Deal pipeline filed will be default sticky for deal filter view and always pipeline will be part of the rule associated with any view(Default, Custom Shared, Custom)
Deal stages field in filter will be updated based on change with deal pipeline field.
Account Filters :
Account filters has both pipeline and stage as non sticky field in filters.
Choosing Deal pipeline field and choosing a value in that field will update the deal stage field choices and make it visible.
Choosing Deal stage field will prefill Deal pipeline field with user prefered pipeline and will update deal stage field choices.
Deal Funnel :
Deal funnel page should have pipeline dropdown , which filter the deals based on views.
Pipeline dropdown shows all pipeline only in Default View.
Custom View and Custom Shared view will have the pipeline associated with that rule.
User Pipeline :
Pipeline preference is categorised into account level and user level
User level pipeline can be set in profile settings, when the user preferred pipeline is deleted the user preference is shifted to account level pipeline
RSpecs
RSpec coverage after this change across deal module is >95%.

Links
Git Initial Squash Commit : https://github.com/freshdesk/freshsales/commit/c01ca031ef247795da8601dd3756d7540e7e7a38
Spec :
Frontend Test case Coverage to Components related to Deal pipeline module .
components/deal-pipeline/ 93.86%
templates/shared/deal-pipeline/ 91.69%
components/modals/bulk-update/ 97.81%
components/filters/dependent-dropdown/ 100%
components/modals/edit-custom-field/ 67.01%
components/modals/deal-form/ 60.38%
Title: Multiple Deal Pipeline
To cater companies that have multiple sales process for different products or markets.
Available from Estate Plan.
Pipeline:
- Account Default - Deal pipeline with is_default as true
- User Default - Deal pipeline associated with the user profile
- In the absence of pipeline attribute. User operations like Import, New Deal will choose User Default pipeline. And Admin operation will choose Account level default pipeline.
- On Delete or Plan downgrade,
- Filter rules & Users migrated to account default pipeline.
- All deals moved to account default pipeline’s default stage
- In filter rules, the constant '-299' indicates the user default pipeline. It will be referred from here -> FsFilter::Constants::USER_DEFAULT_PIPELINE
- Limitation -
- 10 pipelines are allowed for an Account.
- Pipeline names can't be duplicated.
- Account default pipeline can’t be deleted.
Stage:
- Default choice type has been changed to '5' and it can't be deleted but can be edited and position cant be changed. It will be referred from here -> FormService::Constants::CHOICE_TYPES
- Every pipeline will contain 3 mandatory stages, 'New' - Top editable, 'Won' & 'Lost' - Bottom Non Editable. It will be referred from here -> Deals::Pipeline::DEFAULT_DEAL_STAGES
- Mandatory Stages Can't be deleted except the case when pipeline is deleted.
- Stage names are unique within the scope of Pipeline.
Associations:

- deal_pipeline has_many deal_stages
- deal_pipeline has_many deals
- deal belongs_to deal_pipeline
- deal_stage belongs_to deal_pipeline
Deal created via API:
- Pipeline should be specified
- If no pipeline is specified, deals get created in Users default pipeline
- Column Chooser: Pipeline is added as one of the fields in Deals
- Downgrade to lower plans than Garden will delete all deal pipelines except the default one, delete all deal stages related to the pipeline and move the deals of the pipelines to account default pipeline → New stage
Migrations:
- ContactCustomFilters & SalesAccountCustomFilters are updated with
- deal_pipeline_id wherever we have deal_stage_id rule
- DealCustomFilters are updated with deal_pipeline_id rule. It will be account level default pipeline id for custom views and ‘299’ for default / system views.
- Add deal_pipeline_id column
- Mysql - Deal, Deal Stage, User Profile
- Elastic Search
- Redshift
- Update deal_pipeline_id with account default
- pipeline_id
- Update choice type of default stage to 5 from 1
- (5 Indicates top_edit and 1 indicates top_read)
- Add MultiPipeline to plans
- Add is_deleted column to deal_pipeline
- Form Service: Add deal_pipeline in Deal Fields
Fixtures:
- DealCustomFilter is updated with deal_pipeline_id rule(with UserDefaultPIpleineConstant = ‘299’ )
- DealStage - default open stage choice type is updated to 5
CRM Data Migration:
ImportDealCsv -
Deal is going to map with pipeline and corresponding stage according to below conditions:
- If Pipeline is present, then map to corresponding pipeline and if Stage matched to one of this mapped Pipeline’s stage then map to corresponding stage else with pipeline’s default stage
- If Pipeline is blank/not present in account then map to Users default Pipeline and if Stage matched to users default pipeline stages then map it to corresponding stage else with pipeline’s default stage
Other Migrations -
Deal is going to map with pipeline and corresponding stage according to below conditions
- If Pipeline is present in account then map to corresponding Pipeline and If Stage matched to one of this mapped Pipeline’s stages then map to corresponding stage else create new stage in the mapped pipeline
- If Pipeline is blank then map to account default pipeline and If Stage matched with any of mapped pipeline stage then map it to the same else create new stage
- If Pipeline is not present in account then create pipeline and if stage matches with any of created pipeline’s stages then map it to the same else create stage.
Filters:
Deal stage always comes with Pipeline context.
SalesAccount & Contact - DealPipeline and Deal Stage are available in the filter options but not sticky.
Deal:
- List View: Pipeline and Stage are sticky, Pipeline dropdown defaults to User’s default pipeline
- Funnel View: In the UI, user can choose the pipeline for any system generated default views. And Users default pipeline is chosen by default in the dropdown.
Frontend

Deal multiple pipeline UML Diagrams (Model)
Deal pipeline Settings:

Route: deal-pipeline
Controllers: deal-pipeline
Components: deal-pipeline
Deal Field Settings:
Deal pipelines, Deal stages Fields :- Choices should be hidden, and link should be provided to Deal pipeline settings.
Territories Field :- Choices should be hidden, and link should be provided to Territories settings page.
Owners Field :- Choices should be hidden, and link should be provided to User settings page.
Deal Filters:
Deal filters , pipeline field should be added , which is single selection Dropdown.
Deal pipeline filed will be default sticky for deal filter view and always pipeline will be part of the rule associated with any view(Default, Custom Shared, Custom)
Deal stages field in filter will be updated based on change with deal pipeline field.
Account Filters :
Account filters has both pipeline and stage as non sticky field in filters.
Choosing Deal pipeline field and choosing a value in that field will update the deal stage field choices and make it visible.
Choosing Deal stage field will prefill Deal pipeline field with user prefered pipeline and will update deal stage field choices.
Deal Funnel :
Deal funnel page should have pipeline dropdown , which filter the deals based on views.
Pipeline dropdown shows all pipeline only in Default View.
Custom View and Custom Shared view will have the pipeline associated with that rule.
User Pipeline :
Pipeline preference is categorised into account level and user level
User level pipeline can be set in profile settings, when the user preferred pipeline is deleted the user preference is shifted to account level pipeline
RSpecs
RSpec coverage after this change across deal module is >95%.

Links
Git Initial Squash Commit : https://github.com/freshdesk/freshsales/commit/c01ca031ef247795da8601dd3756d7540e7e7a38
Spec :
Frontend Test case Coverage to Components related to Deal pipeline module .
components/deal-pipeline/ 93.86%
templates/shared/deal-pipeline/ 91.69%
components/modals/bulk-update/ 97.81%
components/filters/dependent-dropdown/ 100%
components/modals/edit-custom-field/ 67.01%
components/modals/deal-form/ 60.38%